<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .father{
            /* 1.为父元素添加overflow: hidden;解决塌陷问题 
               2.为父元素定义边框
               3.为父元素添加内边距
            */
            overflow: hidden;
            width: 400px;
            height: 400px;
            background-color: pink;
            margin-top: 20px;
        }
        .son{
            width: 200px;
            height: 200px;
            background-color: purple;
            margin-top: 50px;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son">儿子</div>
    </div>
</body>
</html>